#ifndef _SDF_H
#define _SDF_H

typedef struct DeviceInfo_st{
unsigned char IssuerName[40];
unsigned char DeviceName[16];
unsigned char DeviceSerial[16];
unsigned int DeviceVersion;
unsigned int StandardVersion;
unsigned int AsymAlgAbility[2];
unsigned int SymAlgAbility;
unsigned int HashAlgAbility;
unsigned int BufferSize;
} DEVICEINFO;

#define SDR_OK 0x0

/*打开设备*/
int SDF_OpenDevice( void * * phDeviceHandle);

/*关闭设备*/

int SDF_CloseDevice( void * hDeviceHandle);

/*获取设备信息*/
int SDF_GetDeviceInfo(void * hSessionHandle,DEVICEINFO * pstDeviceInfo) ;

/*产生随机数*/
int SDF_GenerateRandom (void * hSessionHandle,unsigned int uiLength,unsigned char * pucRandom);

/*Error Code */

#define SDR_OK 0x0  //操作成功

#define SDR_BASE 0x01000000  //错误码基础值

# define SDR_UNKNOWERR   SDR_BASE +Ox00000001  //未知错误

#define SDR_NOTSUPPORT  SDR_BASE+0x00000002  //不支持的接口调用

#define SDR_COMMFAIL  SDR_BASE+0x00000003  //与设备通信失败

#define SDR_HARDFAIL  SDR_ BASE + 0x00000004  //运算模块无响应
#define SDR_OPENDEVICE  SDR_ BASE +0x00000005  //打开设备失败
#define SDR_OPENSESSION   SDR_BASE+ 0x00000006  //创建会话失败

#endif